<?php 

class Sanciones_model extends CI_Model{ 
	private $_tabla = 'Sanciones';
    public $idSancion = 0;
    public $dni = 0;
    public $comienzo = 0;
    public $fin = 0;

    public function getAll(){
    	return $this->db->get($this->_tabla)->result_array();
    }
    public function insert(){
    	$this->db->insert($this->_tabla,$this);
    }

    public function update(){
		$this->db->where('idSancion', $this->idSancion);
		$this->db->update($this->_tabla,$this);
	}
	public function getById($id){
	$query = $this->db->query("SELECT * FROM " . $this->_tabla . " WHERE idSancion = '" . $id . "'");

	 foreach ($query->result() as $row)
	 {
		return $row;
	 }
    }


}


  ?>
